import logging
import pytest
from Api.ihrm_loginApi import IhrmLogin
from common.readjsonTools import read_json_file
from config import base_path
from common.assretTools import common_tools
class TestIhrmLogin(object):
    def setup_class(self):
        self.ihrm = IhrmLogin()
    failname = base_path + "/data/logindata.json"
    data = read_json_file(failname)
    @pytest.mark.parametrize("desc,data,status_code,success,code,message",data)
    def test_ihrm_login(self,desc,data,status_code,success,code,message):
        resp = self.ihrm.login(data)
        print(desc, resp.json())
        logging.info(f"这是晚自习作业题的日志信息,{desc},{resp.json()}")


        common_tools(resp, status_code, success, code, message)

